package com.common.www.bean.entity.project;


import org.springframework.boot.base.jpa.domain.annotations.QueryCacheable;
import org.springframework.boot.base.jpa.domain.entity.NumberIdentityEntity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * 所有供应商
 *
 * @param
 * @author andyliu
 * @date 5/28/2018 4:23 PM
 * @return
 */
@DynamicUpdate(true)
@DynamicInsert(true)
@Entity
@Getter
@Setter
@QueryCacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Table()
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "供应商返回参数")
@JsonIgnoreProperties(ignoreUnknown=true)
public class SupplyCompany extends NumberIdentityEntity {

    /**
     * 名称
     */
    @NotNull(message = "请填写名称")
    @Length(max=128,message = "名称最长不超过128位")
    @Column(length = 128, nullable = false)
    @ApiModelProperty(value = "名称", example = "1")
    private String name;
    /**
     * 省份
     */
    @Column(length = 32)
    @Length(max=32,message = "省份名称最长不超过32位")
    @ApiModelProperty(value = "省份", example = "四川省")
    private String province;
    /**
     * 城市
     */
    @Column(length = 32)
    @Length(max=32,message = "市名称最长不超过32位")
    @ApiModelProperty(value = "市", example = "成都市")
    private String city;

    //===============================

    /**
     * 备注
     */
    @Column(length = 4096)
    @Length(max=4096,message = "备注最长不超过4096位")
    private String remarks;
}